package cpt202.project.mapper;

import cpt202.project.dao.RecordMapper;
import cpt202.project.entity.Record;
import org.junit.jupiter.api.RepeatedTest;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;

@SpringBootTest
public class RecordMappertest {

        @Autowired
        private RecordMapper recordMapper;


        @Test
        public void addInfoTest() {
            Record data = new Record(20.0,1,"2022.03.28","日常","纸巾",8);
            recordMapper.addRec(data);
            System.out.println(data.getRecordId());
        }

        @Test
        public void renewInfoTest() {
            Record data = new Record(2,20.0,1,"2022.03.28","教育","书费",7);
            Integer results = recordMapper.updateRec(data);
            System.out.println(results);
        }

        @Test
        public void deleteInfoTest() {
            Integer results = recordMapper.deleteRec(2);
            //print 0 不算过，print 1 才算过
            System.out.println(results);


}
}
